package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_College 商学院
 *
 */
public class TestData_TB_College
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_College saveMust(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_College");
		return (TB_College)repository.save(newMust(
				collegeCategory
			));
	}
	
	public static TB_College newMust(
		bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory
	){
		return new TB_College(new TB_College.MustProperties() {
			/** 标题 */
			@Override public String getTitle(){
				return Generator.generate(0, 255);
			}
			/** 内容 */
			@Override public String getContent(){
				return Generator.generate(0, 20000);
			}
			/** 商学院分类 */
			@Override public bairui.international.model.domain.jpa.TB_CollegeCategory getCollegeCategory(){
				return collegeCategory;
			}
			/** 状态 */
			@Override public com.sh_lianjing.model.status.State_UpDown getState(){
				return com.sh_lianjing.model.status.State_UpDown.Downed;
			}
			/** 时间 */
			@Override public java.util.Date getDate(){
				return new java.util.Date();
			}
			/** 是否显示大图 */
			@Override public Boolean getBigImgFlag(){
				return new java.util.Random().nextBoolean();
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_College saveAll(
		org.springframework.context.ApplicationContext context,
		bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_College");
		return (TB_College)repository.save(newAll(
				collegeCategory
			));
	}
	
	public static TB_College newAll(
		bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory
	){
		return new TB_College(
			new TB_College.MustProperties() {
				/** 标题 */
				@Override public String getTitle(){
					return Generator.generate(0, 255);
				}
				/** 内容 */
				@Override public String getContent(){
					return Generator.generate(0, 20000);
				}
				/** 商学院分类 */
				@Override public bairui.international.model.domain.jpa.TB_CollegeCategory getCollegeCategory(){
					return collegeCategory;
				}
				/** 状态 */
				@Override public com.sh_lianjing.model.status.State_UpDown getState(){
					return com.sh_lianjing.model.status.State_UpDown.Downed;
				}
				/** 时间 */
				@Override public java.util.Date getDate(){
					return new java.util.Date();
				}
				/** 是否显示大图 */
				@Override public Boolean getBigImgFlag(){
					return new java.util.Random().nextBoolean();
				}
			},
			new TB_College.OptionalSingleProperties() {
				/** 摘要 */
				@Override public String getComment(){
					return Generator.generate(0, 500);
				}
			}
		);
	}
	

}
